<template>
  <div>
    <div class="uploading_tab" v-show="!tabType">
      <div class="uploading_tab_item">
        <img :src="TAB02" alt="" width="100%" />
        <div class="tab_content">
          <slot name="tab1"></slot>
        </div>
      </div>

      <div class="uploading_tab_item" @click="changeTab">
        <img :src="TAB01" alt="" width="100%" />
        <div class="tab_content">
          <slot name="tab2"></slot>
        </div>
      </div>
    </div>

    <div class="uploading_tab" v-show="tabType">
      <div class="uploading_tab_item" @click="changeTab">
        <img :src="TAB03" alt="" width="100%" />

        <div class="tab_content">
          <slot name="tab3"></slot>
        </div>
      </div>

      <div class="uploading_tab_item">
        <img :src="TAB04" alt="" width="100%" />
        <div class="tab_content">
          <slot name="tab4"></slot>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { TAB01, TAB02, TAB03, TAB04 } from "@/constant";

export default {
  props: {
    tabType: {
      type: Boolean,
      value: false
    }
  },
  data: function() {
    return { TAB01, TAB02, TAB03, TAB04 };
  },
  methods: {
    changeTab() {
      this.$emit("toggle", this.tabType);
    }
  }
};
</script>

<style lang="scss" scoped>
@import "@/app.scss";

.uploading_tab {
  @include flex_config(center, center, row);
  line-height: 0;

  .uploading_tab_item {
    width: 50%;
    position: relative;

    .tab_content {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      width: 100%;
    }
  }
}
</style>
